import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpDistribute {
  id!: number;
  userId!: number;
  pid: number = 0;
  name?: string;
  phone?: string;
  time1?: string;
  time2?: string;
  jujueContent?: unknown;
  state?: number;
  type?: boolean;
  grade: number = 0;
  uniacid!: number;
}

export const ImsYzdKpDistributeSchema = new EntitySchema({
  class: ImsYzdKpDistribute,
  properties: {
    id: { primary: true, type: 'number' },
    userId: { type: 'number', index: 'user_id' },
    pid: { type: 'number', default: 0, index: 'pid' },
    name: { type: 'string', length: 255, nullable: true },
    phone: { type: 'string', length: 255, nullable: true },
    time1: { type: 'string', length: 255, nullable: true },
    time2: { type: 'string', length: 255, nullable: true },
    jujueContent: { type: 'unknown', columnType: 'longtext', nullable: true },
    state: { type: 'number', nullable: true, index: 'state' },
    type: { type: 'boolean', nullable: true, index: 'type' },
    grade: { type: 'number', default: 0, index: 'grade' },
    uniacid: { type: 'number', index: 'uniacid' },
  },
});
